<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>无标题文档</title>
</head>

<body>
<table width="200" border="1">
  <tr>
    <td>操作</td>
    <td>编号</td>
    <td>姓名</td>
  </tr>
  <tr>
    <td><input type="button" value="选择1" id="btn1" onClick="selectRow(1);"/></td>
    <td id="tablenum1">001</td>
    <td id="tablename1">小明</td>
  </tr>
  <tr>
    <td><input type="button"  value="选择2" id="btn2" onClick="selectRow(2);"/></td>
    <td id="tablenum2">002</td>
    <td id="tablename2">小红</td>
  </tr>
</table>
</body>
<script type="text/javascript">
		function selectRow(rownum){
			var oldwindow = window.opener;
			var tablenum; 
			var tablename;
			if(rownum==1)
			{
			tablenum = document.getElementById("tablenum1").innerHTML;
			tablename = document.getElementById("tablename1").innerHTML;
			}
			if(rownum==2)
			{
			tablenum = document.getElementById("tablenum2").innerHTML;
			tablename = document.getElementById("tablename2").innerHTML;
			}
			oldwindow.setUserID(tablenum);
			oldwindow.setUserName(tablename);
			window.close();
		}
</script>
</html>
